ComponentOne Basic Library for WPF and Silverlight
SetBinding<T>(FrameworkElement,DependencyProperty,T,Expression<Func<T,Object>>,IValueConverter) Method


C1.Silverlight Namespace > Extensions Class > SetBinding Method : SetBinding<T>(FrameworkElement,DependencyProperty,T,Expression<Func<T,Object>>,IValueConverter) Method
Type of the source
The target.
The dependency property which will be set.
The source.
Expression that returns a property of the source object.
The converter that will be applied to the created binding object.
Sets the binding if the dependency property has not been set previously and the style of the element don't set the property.
Syntax
'Declaration
 
<System.Runtime.CompilerServices.ExtensionAttribute()>
Public Overloads Shared Sub SetBinding(Of T)( _
   ByVal target As System.Windows.FrameworkElement, _
   ByVal dp As System.Windows.DependencyProperty, _
   ByVal source As T, _
   ByVal expr As System.Linq.Expressions.Expression(Of Func(Of T,Object)), _
   ByVal converter As System.Windows.Data.IValueConverter _
) 
'Usage
 
Dim target As System.Windows.FrameworkElement
Dim dp As System.Windows.DependencyProperty
Dim source As T
Dim expr As System.Linq.Expressions.Expression(Of Func(Of T,Object))
Dim converter As System.Windows.Data.IValueConverter
 
Extensions.SetBinding(Of T)(target, dp, source, expr, converter)
[System.Runtime.CompilerServices.Extension()]
public static void SetBinding<T>( 
   System.Windows.FrameworkElement target,
   System.Windows.DependencyProperty dp,
   T source,
   System.Linq.Expressions.Expression<Func<T,object>> expr,
   System.Windows.Data.IValueConverter converter
)

Parameters

target
The target.
dp
The dependency property which will be set.
source
The source.
expr
Expression that returns a property of the source object.
converter
The converter that will be applied to the created binding object.

Type Parameters

T
Type of the source
See Also

Reference

Extensions Class
Extensions Members
Overload List